package com.hmall.search.mapper;

import com.github.pagehelper.Page;
import com.hmall.search.dto.Item;
import com.hmall.search.dto.ItemDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description SearchMapper
 * @Author dmx
 * @Date 2024-11-14
 */
@Mapper
public interface SearchMapper {

    /**
     * 查询过滤项
     * @param
     * @return
     */
    // SearchVo searchFilters(ItemDto itemDto);
    List<String> searchCategory(ItemDto itemDto);

    List<String> searchBrand(ItemDto itemDto);

    List<String> selectBranchByCategory(@Param("category") String category);

    /**
     * 分页查询
     * @param itemDto
     * @return
     */
    List<Item> getPage(ItemDto itemDto);


    @Select("SELECT *FROM tb_item where status=1 ORDER BY sold DESC LIMIT 20")
    List<Item> selectTopTwentieth();

}
